<template>
  <div id="app" style="width: 100%;min-height:100vh;background: #fafafa">
    <router-view></router-view>
  </div>
</template>

<script>
import {initLocaLData} from "./utils/local"

export default {
  name: 'App',
  components: {},
  mounted() {
    this.initPageSize()
    window.onresize = () => {//当页面尺寸改变的时候生效
      this.initPageSize()
    }
    initLocaLData()
  },
  methods: {
    initPageSize() {
      let html = document.getElementsByTagName('html')
      let width = html[0].clientWidth
      console.log("clientWidth===", width)
      if (width > 400) {
        let fontsize = width / 400 * 5;
        document.getElementsByTagName('html')[0].style.fontSize = fontsize + 'px'
      }
    }
  }
}
</script>

<style>

</style>
